﻿using System;
using System.Web.UI.WebControls;



using CARMSBusiness;

namespace CARMS.Admin
{
    public partial class EventView : PageBase
    {
        public int EventId
        {
            get
            {
                return GetIntByParameter("EventId");
            }
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var log = LogBusiness.GetLogData(EventId);
                if (log == null)
                {
                    //throw new InvalidParameterException("The event id value does not exist.", "EventId");
                }
                FormPanel1.DataSource = log;
                FormPanel1.DataBind();

                var literal = new Literal
                {
                    Text = string.IsNullOrEmpty(log.Message) ? "None" : Server.HtmlEncode(log.Message).Replace(Environment.NewLine, "<br/>")
                };
                panelMessage.Controls.Add(literal);
 
            }
        }
    }
}
